package com.atos.howl.chaos.pdm.mapper;

import com.atos.howl.chaos.pdm.dto.paihangbang.VideoTop;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author Howl-Xu
 * @version 1.0.0
 * @Description: 请描述一下这个类文件吧
 * @createTime 2020年02月20日 18:06:00
 */
public interface PaihangbangMapper {

    @Select("select\n" +
            "\t(@videoIndex:=@videoIndex+1) videoIndex,\n" +
            "\tcvci.img_80x80 img80x80,\n" +
            "\tcvci.img_220x125 img220x125,\n" +
            "\tcvci.img_325x246 img325x246,\n" +
            "\tcvci.img_470x200 img470x200,\n" +
            "\tsu.nick_name nickName,\n" +
            "\tcv.video_path videoPath,\n" +
            "\tcv.video_id videoId,\n" +
            "\tcv.video_name videoName,\n" +
            "\tcv.video_title videoTitle,\n" +
            "\tcv.video_summary videoSummary,\n" +
            "\tcvai.video_dianzan videoDianzan,\n" +
            "\tcvai.video_bofang videoBofang,\n" +
            "\tcvai.video_toubi videoToubi\n" +
            "from\n" +
            "\tchaos_video_cover_img cvci,\n" +
            "\tsys_user su,\n" +
            "\tchaos_video cv,\n" +
            "\tchaos_video_fenqu cvf,\n" +
            "\tchaos_video_append_info cvai,\n" +
            "\t(SELECT @videoIndex:=0) as videoIndex\n" +
            "where\n" +
            "\tcvci.video_id = cv.video_id\n" +
            "\tand cv.video_id = cvf.video_id\n" +
            "\tand cvai.video_id = cv.video_id\n" +
            "\tand su.user_uuid = cv.user_uuid\n" +
            "order by\n" +
            "\tcvai.video_bofang desc,\n" +
            "\tvideoIndex asc\n" +
            "limit 10")
    List<VideoTop> searchPaihangbangTop11();

    @Select("select\n" +
            "\t(@videoIndex:=@videoIndex+1) videoIndex,\n" +
            "\tcvci.img_80x80 img80x80,\n" +
            "\tcvci.img_220x125 img220x125,\n" +
            "\tcvci.img_325x246 img325x246,\n" +
            "\tcvci.img_470x200 img470x200,\n" +
            "\tsu.nick_name nickName,\n" +
            "\tcv.video_path videoPath,\n" +
            "\tcv.video_name videoName,\n" +
            "\tcv.video_id videoId,\n" +
            "\tcv.video_title videoTitle,\n" +
            "\tcv.video_summary videoSummary,\n" +
            "\tcvai.video_dianzan videoDianzan,\n" +
            "\tcvai.video_bofang videoBofang,\n" +
            "\tcvai.video_toubi videoToubi\n" +
            "from\n" +
            "\tchaos_video_cover_img cvci,\n" +
            "\tsys_user su,\n" +
            "\tchaos_video cv,\n" +
            "\tchaos_video_fenqu cvf,\n" +
            "\tchaos_video_append_info cvai,\n" +
            "\t(SELECT @videoIndex:=0) as videoIndex\n" +
            "where\n" +
            "\tcvci.video_id = cv.video_id\n" +
            "\tand cv.video_id = cvf.video_id\n" +
            "\tand cvai.video_id = cv.video_id\n" +
            "\tand su.user_uuid = cv.user_uuid\n" +
            "order by\n" +
            "\tcvai.video_bofang desc,\n" +
            "\tvideoIndex asc\n" +
            "limit 9")
    List<VideoTop> searchPaihangbangTop9();

    @Select("select\n" +
            "\t(@videoIndex:=@videoIndex+1) videoIndex,\n" +
            "\tcvci.img_80x80 img80x80,\n" +
            "\tcvci.img_220x125 img220x125,\n" +
            "\tcvci.img_325x246 img325x246,\n" +
            "\tcvci.img_470x200 img470x200,\n" +
            "\tsu.nick_name nickName,\n" +
            "\tcv.video_path videoPath,\n" +
            "\tcv.video_name videoName,\n" +
            "\tcv.video_id videoId,\n" +
            "\tcv.video_title videoTitle,\n" +
            "\tcv.video_summary videoSummary,\n" +
            "\tcvai.video_dianzan videoDianzan,\n" +
            "\tcvai.video_bofang videoBofang,\n" +
            "\tcvai.video_toubi videoToubi\n" +
            "from\n" +
            "\tchaos_video_cover_img cvci,\n" +
            "\tsys_user su,\n" +
            "\tchaos_video cv,\n" +
            "\tchaos_video_fenqu cvf,\n" +
            "\tchaos_video_append_info cvai,\n" +
            "\t(SELECT @videoIndex:=0) as videoIndex\n" +
            "where\n" +
            "\tcvci.video_id = cv.video_id\n" +
            "\tand cv.video_id = cvf.video_id\n" +
            "\tand cvai.video_id = cv.video_id\n" +
            "\tand su.user_uuid = cv.user_uuid\n" +
            "order by\n" +
            "\tcvai.video_bofang desc,\n" +
            "\tvideoIndex asc\n" +
            "limit 6")
    List<VideoTop> searchPaihangbangTop6();

    @Select("select\n" +
            "\t(@videoIndex:=@videoIndex+1) videoIndex,\n" +
            "\tcvci.img_80x80 img80x80,\n" +
            "\tcvci.img_220x125 img220x125,\n" +
            "\tcvci.img_325x246 img325x246,\n" +
            "\tcvci.img_470x200 img470x200,\n" +
            "\tsu.nick_name nickName,\n" +
            "\tcv.video_path videoPath,\n" +
            "\tcv.video_name videoName,\n" +
            "\tcv.video_id videoId,\n" +
            "\tcv.video_title videoTitle,\n" +
            "\tcv.video_summary videoSummary,\n" +
            "\tcvai.video_dianzan videoDianzan,\n" +
            "\tcvai.video_bofang videoBofang,\n" +
            "\tcvai.video_toubi videoToubi\n" +
            "from\n" +
            "\tchaos_video_cover_img cvci,\n" +
            "\tsys_user su,\n" +
            "\tchaos_video cv,\n" +
            "\tchaos_video_fenqu cvf,\n" +
            "\tchaos_video_append_info cvai,\n" +
            "\t(SELECT @videoIndex:=0) as videoIndex\n" +
            "where\n" +
            "\tcvci.video_id = cv.video_id\n" +
            "\tand cv.video_id = cvf.video_id\n" +
            "\tand cvai.video_id = cv.video_id\n" +
            "\tand su.user_uuid = cv.user_uuid\n" +
            "order by\n" +
            "\tcvai.video_bofang desc,\n" +
            "\tvideoIndex asc\n" +
            "limit 4")
    List<VideoTop> getPaihangbangTop4();
}
